<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <style>
        table{
	        border-style: solid;
	        border-width: 1px;
	        border-color: black;
	        border-collapse: collapse;
        }
    </style>
    <title>内河载运或拖带超重、超长、超高、超宽、半潜物体申请书</title>
    
	<!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
	<script type="text/javascript">

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	});


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);

		    		//绑定附件材料
					bindMaterialListForm(jsonApply['applyid']);

		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy年mm月dd日'));
			} else{
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;

		    		for(var d in jsonBusiness){//遍历json对象的每个key/value对,p为key
		    			if(d == 'workbegintime' || d == 'workendtime'){
		    				$('#' + d).html(formatDate(jsonBusiness[d], 'yyyy-mm-dd'));
		    			} else {
		    				$('#' + d).html(jsonBusiness[d] == '' ? '/' : jsonBusiness[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}
	
	function bindAcceptForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getacceptinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonAccept = data.datas;
		    		
					for(var d in jsonAccept){//遍历json对象的每个key/value对,p为key

		    			if(d == 'audittime'){
		    				$('#' + d).html(formatDate(jsonAccept[d], 'yyyy年mm月dd日'));
		    			}
		    			else{
		    				$('#' + d).html(jsonAccept[d] == '' ? '/' : jsonAccept[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}
	</script>
</head>
<body>
<div style="height:100px; "></div>
<h1 >内河载运或拖带超重、超长、超高、超宽、半潜物体申请书</h1>
<table border="1" align="center" cellspacing="0" cellpadding="0">
    <tr>
        <td class="td-1">申请人</td>
        <td class="td-2" style="text-align: left;">
			<span id="proposer" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1">申请时间</td>
        <td class="td-2" style="text-align: left;">
			<span id="applytime" style="font-size: 16px; margin-left: 15px;"></span>
        </td>
    </tr>
    <tr>
        <td class="td-1">运载或拖带计划</td>
        <td class="td-2" style="text-align: left;">
			<span id="towingcontent" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1">船舶或拖轮</td>
        <td class="td-2" style="text-align: left;">
			<span id="workshipname" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1">被载货拖物</td>
        <td class="td-2" style="text-align: left;">
			<span id="towingname" style="font-size: 16px; margin-left: 15px;"></span>
        </td>
    </tr>
    <tr>
        <td class="td-3">
            <br>附<br>送<br>材<br>料
        </td>
        <td class="td-2" style="text-align: left;">
        	<span id="material" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-3"><br>其他需要说明的情况</td>
        <td class="td-2" style="text-align: left;">
			<span id="remark" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1">联系人<br>联系方式</td>
        <td class="td-2">
        	<table border="0" style="border-width:0;" align="left">
        		<tr>
	        		<td class="td-1" style="height:30px;text-align: left;" ><p id="workcontactperson" style=" margin-left: 10px;margin-bottom:-2px"></p></td>
	        	</tr>
	        	<tr>
	        		<td class="td-1" style="height:30px;text-align: left;"><p id="workcontactphone" style=" margin-left: 10px;margin-top:-2px"></p></td>
	        	</tr>
        	</table>
        	
        </td>
    </tr>
</table>

</body>
</html>